module.exports = function(window, document) {
	var apivm = require('../../common/avm.min')(window, document);
	var avm = apivm;
	var api = apivm.api;
	var Component = apivm.Component;
	var $ = apivm.$;
	(function() {
	var Ajax = /*@__PURE__*/ (function(Component) {
		function Ajax(props) {
			Component.call(this, props);
			this.data = {};
		}

		if (Component) Ajax.__proto__ = Component;
		Ajax.prototype = Object.create(Component && Component.prototype);
		Ajax.prototype.constructor = Ajax;
		Ajax.prototype.apiready = function() {};
		Ajax.prototype.getApiInfo = function() {
			api.ajax(
				{
					url: "http://api.cpengx.cn/shortvideo/api"
				},
				function(ret, err) {
					console.log(ret);
					console.log(err);
				}
			);
		};
		Ajax.prototype.getApiSearch = function() {
			api.ajax(
				{
					url: "http://api.cpengx.cn/shortvideo/api/search?query=" + "赵丽颖"
				},
				function(ret, err) {
					console.log(ret);
				}
			);
		};
		Ajax.prototype.postApiLogin = function() {
			api.ajax(
				{
					url: "http://api.cpengx.cn/shortvideo/api/login",
					method: "post",
					headers: {
						"Content-Type": "application/json;charset=utf-8"
					},

					data: {
						body: {
							account: "cc007",
							password: "123456"
						}
					}
				},

				function(ret, err) {
					console.log(ret);
				}
			);
		};
		Ajax.prototype.render = function() {
			var this$1 = this;
			return apivm.h(
				"view",
				{class: "page"},
				apivm.h(
					"button",
					{
						onclick: function(event) {
							if (this$1.getApiInfo) {
								this$1.getApiInfo(event);
							} else {
								getApiInfo(event);
							}
						}
					},
					"调用短视频AJAX接口"
				),
				apivm.h(
					"button",
					{
						onclick: function(event) {
							if (this$1.getApiSearch) {
								this$1.getApiSearch(event);
							} else {
								getApiSearch(event);
							}
						}
					},
					"发送get参数查询数据"
				),
				apivm.h(
					"button",
					{
						onclick: function(event) {
							if (this$1.postApiLogin) {
								this$1.postApiLogin(event);
							} else {
								postApiLogin(event);
							}
						}
					},
					"发送post参数实现登录"
				)
			);
		};

		return Ajax;
	})(Component);
	apivm.define("ajax", Ajax);
	apivm.render(apivm.h("ajax", null), "body");
})();

	window['createApp'] = function() {
		apivm.$_start();
	}
	return avm;
}